package xuegao.study.mall.rbac.service;

import org.springframework.transaction.annotation.Transactional;
import xuegao.study.mall.common.api.CommonResult;
import xuegao.study.mall.common.domain.UserDto;
import xuegao.study.mall.common.dto.rbac.UmsAdminRegisterDto;
import xuegao.study.mall.common.model.ums.UmsAdmin;
import xuegao.study.mall.common.model.ums.UmsRole;

import java.util.List;

public interface UmsAdminService {

    @Transactional
    int register(UmsAdminRegisterDto registerDto);

    @Transactional
    int deleteById(Long id);

    /**
     * 更新用户启用状态
     */
    @Transactional
    int updateAdminStatus(Long adminId, Integer status);

    @Transactional
    int updateAdmin(Long id, UmsAdmin admin);

    CommonResult getAdminInfo(String userStr);

    List<UmsAdmin> selectList(Integer pageNum, Integer pageSize, String name);

    List<UmsRole> adminRoles(Long adminId);

    @Transactional
    int allocRoles(Long adminId, List<Long> roleIds);

    UserDto getUserByUsername(String username);

    UmsAdmin getAdminByUsername(String username);
}
